<template>
    <van-tabbar v-model="active"  route>
        <van-tabbar-item to="/home" icon="home-o">首页</van-tabbar-item>
        <van-tabbar-item to="/car" icon="logistics">购物车</van-tabbar-item>
        <van-tabbar-item to="/user" icon="user-o" v-show="flag">
          <span>我的</span>
        </van-tabbar-item>
        <van-tabbar-item to="/login" icon="user-o" v-show="!flag">
        <span>登录</span>
        </van-tabbar-item>
      </van-tabbar>
</template>

<script setup lang="ts">
    import {ref,computed} from "vue"
    let active = ref(0)
    const flag = computed(()=>{
      return localStorage.getItem("token")
    })
</script>

<style scoped>

</style>